package com.jswl.training.springjpa.service;

import com.jswl.training.springjpa.entity.User;
import com.jswl.training.springjpa.entity.vo.UserVo;
import com.querydsl.core.QueryResults;
import com.querydsl.core.Tuple;
import org.springframework.data.domain.Page;

import java.util.List;

public interface UserService {

    /**
     * 保存用户信息
     *
     * @param user
     */
    public void saveUser(User user);


    /**
     * 分页查询用户信息
     *
     * @param pageIndex 页码
     * @param pageSize  每页显示记录数
     * @return
     */
    public Page<User> getPage(Integer pageIndex, Integer pageSize);

    /**
     * 根据用户昵称查找用户
     * @param userName
     * @return
     */
    public List<User> findByUserName(String userName);

    public List<User> getUsersBy(String userName);

    /**
     * 测试QueryDSL
     * @param userName
     * @param phone
     * @return
     */
    public List<User> getByUserNameAndPhone(String userName,String phone);

    public Page<UserVo> getUserVoByUserName(String userName);

}
